linalg_lu Module



Interfaces

public interface form_lu

  • private pure subroutine form_lu_all(lu, ipvt, u, p)

    Extracts the L and U matrices from the condensed [L\U] storage format used by the lu_factor.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(inout), dimension(:,:) :: lu

    On input, the N-by-N matrix as output by lu_factor. On output, the N-by-N lower triangular matrix L.

    integer(kind=int32), intent(in), dimension(:) :: ipvt

    The N-element pivot array as output by lu_factor.

    real(kind=real64), intent(out), dimension(:,:) :: u

    An N-by-N matrix where the U matrix will be written.

    real(kind=real64), intent(out), dimension(:,:) :: p

    An N-by-N matrix where the row permutation matrix will be written.

  • private pure subroutine form_lu_all_cmplx(lu, ipvt, u, p)

    Extracts the L and U matrices from the condensed [L\U] storage format used by the lu_factor.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(inout), dimension(:,:) :: lu

    On input, the N-by-N matrix as output by lu_factor. On output, the N-by-N lower triangular matrix L.

    integer(kind=int32), intent(in), dimension(:) :: ipvt

    The N-element pivot array as output by lu_factor.

    complex(kind=real64), intent(out), dimension(:,:) :: u

    An N-by-N matrix where the U matrix will be written.

    real(kind=real64), intent(out), dimension(:,:) :: p

    An N-by-N matrix where the row permutation matrix will be written.

  • private pure subroutine form_lu_only(lu, u)

    Extracts the L and U matrices from the condensed [L\U] storage format used by the lu_factor.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(inout), dimension(:,:) :: lu

    On input, the N-by-N matrix as output by lu_factor. On output, the N-by-N lower triangular matrix L.

    real(kind=real64), intent(out), dimension(:,:) :: u

    An N-by-N matrix where the U matrix will be written.

  • private pure subroutine form_lu_only_cmplx(lu, u)

    Extracts the L and U matrices from the condensed [L\U] storage format used by the lu_factor.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(inout), dimension(:,:) :: lu

    On input, the N-by-N matrix as output by lu_factor. On output, the N-by-N lower triangular matrix L.

    complex(kind=real64), intent(out), dimension(:,:) :: u

    An N-by-N matrix where the U matrix will be written.

public interface lu_factor

  • private pure subroutine lu_factor_dbl(a, ipvt, lu, l, u, p)

    Computes the LU factorization of an M-by-N matrix.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(inout), dimension(:,:) :: a

    The N-by-N matrix to factor.

    integer(kind=int32), intent(out), optional, allocatable, target, dimension(:) :: ipvt

    An N-element array used to track row-pivot operations. The array stored pivot information such that row I is interchanged with row IPVT(I).

    real(kind=real64), intent(out), optional, allocatable, target, dimension(:,:) :: lu

    The N-by-N factored matrix in the form [\ ] where the unit diagonal elements of are not stored.

    real(kind=real64), intent(out), optional, allocatable, target, dimension(:,:) :: l

    The N-by-N lower triangular matrix .

    real(kind=real64), intent(out), optional, allocatable, target, dimension(:,:) :: u

    The N-by-N upper triangular matrix .

    real(kind=real64), intent(out), optional, allocatable, target, dimension(:,:) :: p

    The N-by-N row permutation matrix.

  • private pure subroutine lu_factor_cmplx(a, ipvt, lu, l, u, p)

    Computes the LU factorization of an M-by-N matrix.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(inout), dimension(:,:) :: a

    The N-by-N matrix to factor.

    integer(kind=int32), intent(out), optional, allocatable, target, dimension(:) :: ipvt

    An N-element array used to track row-pivot operations. The array stored pivot information such that row I is interchanged with row IPVT(I).

    complex(kind=real64), intent(out), optional, allocatable, target, dimension(:,:) :: lu

    The N-by-N factored matrix in the form [\ ] where the unit diagonal elements of are not stored.

    complex(kind=real64), intent(out), optional, allocatable, target, dimension(:,:) :: l

    The N-by-N lower triangular matrix .

    complex(kind=real64), intent(out), optional, allocatable, target, dimension(:,:) :: u

    The N-by-N upper triangular matrix .

    real(kind=real64), intent(out), optional, allocatable, target, dimension(:,:) :: p

    The N-by-N row permutation matrix.

  • private pure subroutine csr_lu_factor(a, lu, ju, droptol)

    Factors a matrix using an LU decomposition.

    Arguments

    Type IntentOptional Attributes Name
    class(csr_matrix), intent(in) :: a

    The matrix to factor.

    type(msr_matrix), intent(out) :: lu

    The LU matrix.

    integer(kind=int32), intent(out), dimension(:) :: ju

    The row tracking array.

    real(kind=real64), intent(in), optional :: droptol

    The drop tolerance for the ILUT factorization.

public interface solve_lu

  • private pure function solve_lu_mtx(a, ipvt, b) result(x)

    Solves a system of LU-factored equations.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in), dimension(:,:) :: a

    The N-by-N LU factored matrix as output by lu_factor.

    integer(kind=int32), intent(in), dimension(:) :: ipvt

    The N-element pivot array as output by lu_factor.

    real(kind=real64), intent(in), dimension(:,:) :: b

    The N-by-NRHS right-hand-side matrix.

    Return Value real(kind=real64), allocatable, dimension(:,:)

    The N-by-NRHS solution matrix.

  • private pure function solve_lu_mtx_cmplx(a, ipvt, b) result(x)

    Solves a system of LU-factored equations.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(in), dimension(:,:) :: a

    The N-by-N LU factored matrix as output by lu_factor.

    integer(kind=int32), intent(in), dimension(:) :: ipvt

    The N-element pivot array as output by lu_factor.

    complex(kind=real64), intent(in), dimension(:,:) :: b

    The N-by-NRHS right-hand-side matrix.

    Return Value complex(kind=real64), allocatable, dimension(:,:)

    The N-by-NRHS solution matrix.

  • private pure function solve_lu_vec(a, ipvt, b) result(x)

    Solves a system of LU-factored equations.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in), dimension(:,:) :: a

    The N-by-N LU factored matrix as output by lu_factor.

    integer(kind=int32), intent(in), dimension(:) :: ipvt

    The N-element pivot array as output by lu_factor.

    real(kind=real64), intent(in), dimension(:) :: b

    The N-element right-hand-side array.

    Return Value real(kind=real64), allocatable, dimension(:)

    The N-element solution array.

  • private pure function solve_lu_vec_cmplx(a, ipvt, b) result(x)

    Solves a system of LU-factored equations.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(in), dimension(:,:) :: a

    The N-by-N LU factored matrix as output by lu_factor.

    integer(kind=int32), intent(in), dimension(:) :: ipvt

    The N-element pivot array as output by lu_factor.

    complex(kind=real64), intent(in), dimension(:) :: b

    The N-element right-hand-side array.

    Return Value complex(kind=real64), allocatable, dimension(:)

    The N-element solution array.

  • private pure function csr_lu_solve(lu, ju, b) result(x)

    Solves a linear system using an LU decomposition.

    Arguments

    Type IntentOptional Attributes Name
    class(msr_matrix), intent(in) :: lu

    The LU matrix.

    integer(kind=int32), intent(in), dimension(:) :: ju

    The row tracking array.

    real(kind=real64), intent(in), dimension(:) :: b

    The right-hand side.

    Return Value real(kind=real64), allocatable, dimension(:)

    The solution.